package com.numberma.userservice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Log  implements Serializable {
    private static final long serialVersionUID = 1L;
    private Long userId;      // 操作用户ID
    private String action;    // 操作类型，如："REGISTER", "UPDATE_USER"
    private String ip;        // 操作IP地址
    private String detail;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")// 操作详情（JSON格式）
    private LocalDateTime operationTime; // 操作时间


    public Log(Long userId, String action, String ip, LocalDateTime operationTime) {
        this.userId = userId;
        this.action = action;
        this.ip = ip;
        this.operationTime = operationTime;
    }
}
